#include "descr/descr_sm_factions_parser.h"


using namespace std;


bool DescrSmFactionsParser::parse(string line)
{
	string token = popNextToken(line);
	if (token.compare("faction") == 0)
	{
		string factionID = popNextToken(line);
		shared_ptr<Faction> faction(new Faction());
		faction->id = factionID;
		Faction::add(faction);
		parsingFaction = faction;
	}
	else if (token.compare("culture") == 0)
	{
		parsingFaction->cultureID = popNextToken(line);
	}
	else if (token.compare("symbol") == 0)
	{
		parsingFaction->symbolPath = basePath + popNextToken(line);
	}

	return true;
}